<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>What is zhis sha?</title>
<script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-red/easyui.css">

<script type="text/javascript">

</script> 
</head>
<body>
<link rel="stylesheet" href="../static/oyp/css/recruit_rcplan.css?<%=Math.random()%>">
<script type="text/javascript">
		$(function(){
			//初始化表格
			$('#recplan_ss').datagrid({
			    url:'recruitplancs',
			    columns:[[
					{field:'FUZEEMP',width:2,title:'负责人',align:'center'
						//,formatter: function(value,row,index){
						//	if(row["PER_EMPID"]==undefined){
						//		return "<span onclick='tianjia_fuzerenss()'>请添加负责人</span>";
						//	}else{
						//		return value;
						//	}
						//}
					},
					{field:'PER_EMPID',width:2,title:'负责人',hidden:true,align:'center'},
					{field:'SHENQINGEMP',width:2,title:'申请人',align:'center'},
					{field:'ALTNUM',width:1,title:'人数',align:'center'},
					{field:'ALTFW',width:2,title:'对内/对外',align:'center'},
					{field:'ALTMINTIME',width:2,title:'开始时间',align:'center',
						formatter: function(value,row,index){
							return new Date(value).getFullYear() + '-' 
							+ (new Date(value).getMonth() + 1) + '-' 
							+ new Date(value).getDate();
						}
					},
					{field:'ALTMAXTIME',width:2,title:'截止时间',align:'center',
							formatter: function(value,row,index){
								return new Date(value).getFullYear() + '-' 
								+ (new Date(value).getMonth() + 1) + '-' 
								+ new Date(value).getDate();
							}
					},{field:'ALTSTAT',width:2,title:'状态',align:'center',
						formatter:function(value){
							if(value==3){
								return "招聘申请中"
							}else if(value==4){
								return "已计入招聘计划"
							}else if(value==5){
								return "计划进行中"
							}else if(value==6){
								return "计划已完成"
							}else{
								return "错误状态"
							}
						}
					},
					{field:'caozuo',width:4,title:'操作',align:'center',
						formatter: function (value, row, index) {
							if(row["ALTSTAT"]==3){
								/* <span onclick='xiugai_fuzerenss()'>修改负责人</span> */
								return "<span onclick='lieru_recruit()'>列入计划</span>";
							}else if(row["ALTSTAT"]==4){
								return "<span onclick='kaishi_jihua()'>开始计划</span>"
							}else if(row["ALTSTAT"]==5){
								return "<span>无操作</span>"
							}else if(row["ALTSTAT"]==6){
								return "<span>无操作</span>"
							}
				            //return "<span onclick='lieru_recruit()'>列入计划</span>/\
				            //<span onclick='xiugai_fuzerenss()'>修改负责人</span>/\
				            //<span>开始计划</span>/\
				            //<span>查看详情</span>"
				        } 
					}
			    ]],
			    pagination:true,
			    pageNumber:1,
			    pageSize:10,
			    pageList:[10,20,30]
			});
			//查询
			$("#recplan_sousuo").click(function(){
				var sskuang=$("#recplan_kuang").val();
				$("#recplan_ss").datagrid('load',{
					w:sskuang
				})				
			});
		});
		//修改负责人
		function xiugai_fuzerenss(){
			var rows=$("#recplan_ss").datagrid("getChecked");
        	//alert(rows[0].ALTID);
			$("#xiugai_fuzeren").window("open");
        	$.ajax({
        		type:"post",
        		url:"xiugai_jihuaplans",
        		data:{waltid:rows[0].ALTID},
        		success:function(){
        			$("#recplan_ss").datagrid();
        		}
        	});
		}
		$("#guanbi_xiugai_le").click(function(){
			$("#xiugai_fuzeren").window("close");
		})
		//列入招聘计划
		function lieru_recruit(){
			var rows=$("#recplan_ss").datagrid("getChecked");
			//alert(rows[0].ALTID);
			$.ajax({
				type:"post",
				url:"jiru_jihuaplans",
				data:{liejihua:rows[0].ALTID},
				success:function(){
					$("#recplan_ss").datagrid();
				}
			});
		}
		//开始计划
		function kaishi_jihua(){
			var rows=$("#recplan_ss").datagrid("getChecked");
			//alert(rows[0].ALTID);
			$.ajax({
				type:"post",
				url:"kaishi_recruit",
				data:{dahuiwaltes:rows[0].ALTID},
				success:function(){
					$("#recplan_ss").datagrid();
				}
			});
		}
	</script>
<div class="full_scr bj_home">
	<div class="bj_img" style="background-image:${hopa.perPmsZts[0].ztback}"></div>
	<div class="bj_txt">
		<div class="bj_small bj_s_w7">
			 <div class="rcplanbox">
			    <div>
			      <div class="topbox">
			        <div class="sousuobox">
			            <input type="text" id="recplan_kuang"  style="width:180px;height:30px;font-size:20px;"placeholder="请输入申请人">
			            <input type="button" id="recplan_sousuo" value="搜索" class="sousuoan">
			            <!-- <input type="button" value="添加计划" class="recuitplan_shenqing"> -->
			        </div>
			        
			      </div>
			      <div class="biaobox">
			          <table id="recplan_ss" class="easyui-datagrid"
			           data-options="width:1000,fitColumns:true,height:400,singleSelect: true">
			        </table>
			      </div>
			    </div>
			    <!-- 
			    <div id="tianjia_fuzeren" class="easyui-window" title="添加计划负责人" style="width:350px;height:200px"data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
			 	   <div class="shangchu_title">
			 	   	    <input type="hidden" id="sedrtghfedfhjmhgfdb">
			 	        <div style="width:75%;margin:40px auto;font-size:17px;">添加负责人:
			 	            <select id="fuzerenidss"style="width:140px;height:30px;font-size:17px;">
					  	      <c:forEach items="${fuzerennames }" var="fuzeren">
					  	      	  <option value="${fuzeren.EMPID }">${fuzeren.EMPNAME }</option>
					  	      </c:forEach>
					  	  </select>
			 	        </div>
			 	   </div>
				   <div class="shangchu_an">
				       <input type="button" id="queding_tianjia_ss" class="qdshangchu" value="确认添加">
				       <input type="button" id="guanbi_tianjia_le" class="quxiaole" value="取消">
				   </div>
			 </div>
			     -->
			 <div id="xiugai_fuzeren" class="easyui-window" title="修改计划负责人" style="width:350px;height:200px"data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
			 	   <div class="shangchu_title">
			 	      <div style="width:75%;margin:40px auto;font-size:17px;">修改负责人:
			 	          <select id="mgmidss"style="width:140px;height:30px;font-size:17px;">
						      <c:forEach items="${fuzerennames }" var="fuzeren">
						      	<option value="${fuzeren.EMPID }">${fuzeren.EMPNAME }</option>
						      </c:forEach>
						  </select>
			 	       </div>
			 	   </div>
				   <div class="shangchu_an">
				       <input type="button" id="queding_shangchu" class="qdshangchu" value="确认修改">
				       <input type="button" id="guanbi_xiugai_le" class="quxiaole" value="取消">
				   </div>
			 </div>
			   <!-- 
			    <div id="recuit_plan" class="easyui-window" title="添加招聘计划" style="width:400px;height:450px"
			 	     		data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
			 	     <div style="width:90%;margin:0px auto;padding:20px 0px;">
			              <div class="recruit_box_neirngbox">
			                  <div class="lei1">负责人：<input type="text" class="kkssa1"></div>
			                  <div class="lei2">人数：<input type="text" class="kkssa2"></div>
			                  <div class="lei3">开始时间：
			                      <input  id="dd"  type= "text" class= "easyui-datebox" required ="required">
			                  </div>
			                  <div class="lei4">截止时间：
			                      <input  id="dd"  type= "text" class= "easyui-datebox" required ="required"> </input>
			                  </div>
			                  <div class="lei5">
			                      <input type="button" class="jhqueding" value="确定">
			                      <input type="button" class="jhquxiao" value="取消">
			                  </div>
			              </div> 
			        </div>
			    </div>
			    -->
			 </div>
		</div>
	</div>
</div>
</body>
</html>